<html>
<head><meta charset="utf-8"><title>Generate Random rust programs · t-compiler/help · Zulip Chat Archive</title></head>
<h2>Stream: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/index.html">t-compiler/help</a></h2>
<h3>Topic: <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Generate.20Random.20rust.20programs.html">Generate Random rust programs</a></h3>

<hr>

<base href="https://rust-lang.zulipchat.com">

<head><link href="https://rust-lang.github.io/zulip_archive/style.css" rel="stylesheet"></head>

<a name="225217746"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Generate%20Random%20rust%20programs/near/225217746" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Aman Arora <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Generate.20Random.20rust.20programs.html#225217746">(Feb 04 2021 at 20:27)</a>:</h4>
<p>Is there a tool like this for Rust? <a href="https://embed.cs.utah.edu/csmith/">https://embed.cs.utah.edu/csmith/</a></p>



<a name="225321606"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Generate%20Random%20rust%20programs/near/225321606" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Julian-Wollersberger <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Generate.20Random.20rust.20programs.html#225321606">(Feb 05 2021 at 16:31)</a>:</h4>
<p>I don't think so. At least the rust repo doesn't have any fuzzer tests.</p>



<a name="225423020"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Generate%20Random%20rust%20programs/near/225423020" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> oliver <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Generate.20Random.20rust.20programs.html#225423020">(Feb 06 2021 at 17:57)</a>:</h4>
<p>I think there is <a href="https://lcamtuf.coredump.cx/afl/"><code>afl</code></a>, this: <a href="https://llvm.org/docs/LibFuzzer.html">https://llvm.org/docs/LibFuzzer.html</a> via <code>cargo-fuzz</code>, also <a href="https://crates.io/crates/honggfuzz"><code>hongfuzz</code></a></p>



<a name="225438613"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Generate%20Random%20rust%20programs/near/225438613" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Joshua Nelson <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Generate.20Random.20rust.20programs.html#225438613">(Feb 07 2021 at 01:09)</a>:</h4>
<p>Afl is a lot more limited than csmith though. It fuzzes raw bytes, csmith only generates valid C code</p>



<a name="225562946"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Generate%20Random%20rust%20programs/near/225562946" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Generate.20Random.20rust.20programs.html#225562946">(Feb 08 2021 at 15:47)</a>:</h4>
<p>I'm not aware of any equivalent to csmith.</p>



<a name="225562985"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Generate%20Random%20rust%20programs/near/225562985" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Josh Triplett <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Generate.20Random.20rust.20programs.html#225562985">(Feb 08 2021 at 15:47)</a>:</h4>
<p>I would love to see one.</p>



<a name="225563447"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Generate%20Random%20rust%20programs/near/225563447" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> simulacrum <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Generate.20Random.20rust.20programs.html#225563447">(Feb 08 2021 at 15:50)</a>:</h4>
<p>(I think there have been some efforts, though; e.g. see <a href="https://github.com/rust-lang/rust/issues/78336">https://github.com/rust-lang/rust/issues/78336</a> which notes it was generated by a WIP tool called Kira, and reduced by Perses.</p>



<a name="225751426"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Generate%20Random%20rust%20programs/near/225751426" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Generate.20Random.20rust.20programs.html#225751426">(Feb 09 2021 at 20:21)</a>:</h4>
<p>Yeah, a lot of issues have been opened that say they were discovered with Kira/Perses.</p>



<a name="225751831"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Generate%20Random%20rust%20programs/near/225751831" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Andrea Nall <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Generate.20Random.20rust.20programs.html#225751831">(Feb 09 2021 at 20:24)</a>:</h4>
<p>Isn't Perses just a test-case reducer?</p>



<a name="225787612"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Generate%20Random%20rust%20programs/near/225787612" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Generate.20Random.20rust.20programs.html#225787612">(Feb 10 2021 at 02:35)</a>:</h4>
<p>Yes, I think so. But Kira seems to be a program that generates programs to try to find bugs in rustc.</p>



<a name="225787618"></a>
<h4><a href="https://rust-lang.zulipchat.com#narrow/stream/182449-t-compiler/help/topic/Generate%20Random%20rust%20programs/near/225787618" class="zl"><img src="https://rust-lang.github.io/zulip_archive/assets/img/zulip.svg" alt="view this post on Zulip" style="width:20px;height:20px;"></a> Noah Lev <a href="https://rust-lang.github.io/zulip_archive/stream/182449-t-compiler/help/topic/Generate.20Random.20rust.20programs.html#225787618">(Feb 10 2021 at 02:35)</a>:</h4>
<p>From the issue:</p>
<blockquote>
<p>The bug is found by our work-in-progress compiler testing tool Kira</p>
</blockquote>



<hr><p>Last updated: Aug 07 2021 at 22:04 UTC</p>
</html>